package edu.nf.ssm;

import com.github.pagehelper.PageInfo;
import edu.nf.ssm.config.RootConfig;
import edu.nf.ssm.entity.City;
import edu.nf.ssm.service.CityService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author wangl
 * @date 2025/5/16
 */
public class Main {

    public static void main(String[] args) throws SQLException {
        ApplicationContext context = new AnnotationConfigApplicationContext(RootConfig.class);
        CityService service = context.getBean(CityService.class);
        PageInfo<City> pageInfo = service.listCity(1, 10);
        System.out.println(pageInfo);
    }
}